<template>
  <el-dialog
    top="30px"
    width="80%"
    append-to-body
    :visible.sync="visible"
    :close-on-click-modal="false"
    :before-close="beforeClose"
  >
    <el-tabs v-model="active">
      <el-tab-pane label="项目信息" name="first">
        <info-view :related-data="relatedData"></info-view>
      </el-tab-pane>
      <el-tab-pane label="项目审批表">
        <approve-view :query-id="queryId" view-mode></approve-view>
      </el-tab-pane>
      <el-tab-pane label="调查附件">
        <invest-attach-main :related-id="queryId" view-mode></invest-attach-main>
      </el-tab-pane>
      <!-- <el-tab-pane label="立项附件">
        <item-attach-main :related-id="queryId"
                          view-mode></item-attach-main>
      </el-tab-pane> -->
      <el-tab-pane label="担保意向函" name="letter" v-if="+relatedData.ele_letter_status > 0">
        <letter-view :query-id="queryId"></letter-view>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>

<script>
import ApproveView from '@/bigcredit/views/self/fast/invest/components/Main'
import InvestAttachMain from '@/credit/views/city/self/normal/invest/AttachMain'
import LetterView from '@/credit/views/county/unionProvince/components/LetterView'
import InfoView from '@/credit/views/city/bus/normal/Info'

export default {
  components: {
    ApproveView,
    // ItemAttachMain,
    InvestAttachMain,
    LetterView,
    InfoView,
  },
  props: {
    visible: Boolean,
    relatedData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      active: 'first',
    }
  },
  computed: {
    queryId() {
      return this.relatedData.customer_related_id || ''
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    beforeClose() {
      this.active = 'first'
      this.$emit('update:visible', false)
    },
  },
}
</script>

<style lang="scss" scoped></style>
